package com.atg.atgchat.init.user.wxmp.adapter;
import com.atg.atgchat.init.user.model.entity.User;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.bean.WxOAuth2UserInfo;
/*
author: atg
time: 2025/1/14 12:12
*/


@Slf4j
public class userAdapter {

    public static User buildUser(String openId) {
      return   User.builder().openId(openId).build();
    }

    public static User buildAuthorizeUser(Long id, WxOAuth2UserInfo userInfo) {
        User user = new User();
        user.setId(id);
        user.setAvatar(userInfo.getHeadImgUrl());
        user.setName(userInfo.getNickname());
        return user;
    }
}
